<?php
include("startsess.php");
if($log){
?>

<?php
if($_SESSION['edoc_read']>0){
?>
<?php
    if(isset($_POST['depart_id']))
        $depart_id = $_POST['depart_id'];
    else if(isset($_GET['depart_id']))
        $depart_id = $_GET['depart_id'];
    else
        $depart_id = $_SESSION['edoc_depart_id'];

?>


<form action="action_sent.php" method="post" id="list_doc_form">
<input type="hidden" name="domain" value="list_doc">
<table cellpadding="5" cellspacing="0" border="0">
<tr><td>หน่วยงาน</td><td>:</td><td>
<?php 
        list_department_userR($depart_id,"list_doc_form"); 
?>
</td></tr>
</table>
<br />

<table cellpadding="3" cellspacing="0" border="1" valign="top" width="100%">
<tr><td colspan="13">
<span class="redheader">รายการหนังสือส่ง</span>
</td></tr>
<tr><td colspan="13"> </td></tr>
<?php
    list_doc_send_to($depart_id);
?>
<tr><td colspan="13"> </td></tr>
<tr><td colspan="13"> </td></tr>
</table>

<?php
}else{
?>
<span class="err">You can not do this function ...<br /></span><br />
<?php
}
?>
<?php
}else{
	echo "Log in fail ...<br /><br />";
}
include("ft.php");
?>
